var apiurl = "http://192.168.204.201:20100/";

function request(url, data, type,token) {
	
	return new Promise((res, rej) => {
		mui.ajax(apiurl + url, {
			data: data,
			dataType: 'json', //服务器返回json格式数据
			type: type, //HTTP请求类型
			timeout: 10000, //超时时间设置为10秒；
			headers: {
				"Content-Type":"application/json",
				"Authorization": token
			},
			success: function(data) {
				console.log(data)
				res(data)
			},
			error: function(xhr, type, errorThrown) {
				rej(xhr)
			}
		});
	});
}

async function getdata() {
	
	let login = await request("/prod-api/api/login", {
		"username": "test01",
		"password": "123456"
	}, "post","");
	
	let list = await request("/prod-api/api/community/member-family/list", null, "get",localStorage.getItem("token"));
	
	let del = await request("/prod-api/api/community/member-family/19", null, "delete",localStorage.getItem("token"));

}

// getdata();